<template>
    <div class="teamwork_container">
        <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/market/marketingPlay' }"><i class="el-icon-lx-cascades"></i>营销玩法</el-breadcrumb-item>
            <el-breadcrumb-item :to="{ path: '/teamwork' }">拼团</el-breadcrumb-item>
            <el-breadcrumb-item v-if="pageType === 'create'">{{ create[num] }}</el-breadcrumb-item>
            <el-breadcrumb-item v-if="pageType === 'edit'">{{ edit[num] }}</el-breadcrumb-item>
            <el-breadcrumb-item v-if="pageType === 'view'">{{ view }}</el-breadcrumb-item>
        </el-breadcrumb>
        <router-view></router-view>
    </div>
</template>

<script>
export default {
    data() {
        return {
            num: 0,
            pageType: 'create',            
            create: ['创建普通拼团','创建邀新拼团','创建阶梯拼团'],
            edit: ['编辑普通拼团','编辑邀新拼团','编辑阶梯拼团'],
            view: '拼团详情',
            warning: '若拼团商品为虚拟商品（会员除外），在用户拼团成功前（注：付款不视为拼团成功，只有达到成团人数才视为拼团成功），请勿通过其他功能（如：兑换码、邀请码、优惠券、学员导入等）授予其权益，否则会视为拼团失败，其拼团订单也会自动退款',
        };
    },
    watch: {
        $route: {
            handler(newVal,oldVal){
                this.num = newVal.query.teamType || 0;
                this.pageType = newVal.query.type || 'create';
            },
            immediate: true
        }
    },
    created(){

    },
    mounted() {
        
    },

    methods: {
        createTeam(n){  // 立即创建
            this.$router.push({
                path: '/teamwork/create_team',
                query: {
                    teamType: n
                }
            });
            console.log(this.$router)
        },
        
        
        
    },
};
</script>

<style lang="scss" scoped>
.teamwork_container{
    .el-alert--warning{
        margin: 10px 0;
    }
}
</style>